package com.cyan.note.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * 打手信息实体类
 * 对应数据库表: workers
 * 
 * @author ZhangzhenYu
 * @since 2025-01-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Worker extends BaseEntity {

    /**
     * 关联用户ID
     */
    private Long userId;

    /**
     * 所属店铺ID
     */
    private Long shopId;

    /**
     * 打手编号
     */
    private String workerCode;

    /**
     * 真实姓名
     */
    private String realName;

    /**
     * 昵称
     */
    private String nickname;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 身份证号
     */
    private String idCard;

    /**
     * 性别
     */
    private String gender;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 头像URL
     */
    private String avatar;

    /**
     * 在线状态
     */
    private String status;

    /**
     * 账户状态
     */
    private String accountStatus;

    /**
     * 技能标签(JSON)
     */
    private String skillTags;

    /**
     * 服务描述
     */
    private String serviceDescription;

    /**
     * 分成比例(%)
     */
    private BigDecimal commissionRate;

    /**
     * 打手等级
     */
    private String level;

    /**
     * 最大并发订单数
     */
    private Integer maxConcurrentOrders;

    /**
     * 工作开始时间
     */
    private LocalTime workHoursStart;

    /**
     * 工作结束时间
     */
    private LocalTime workHoursEnd;

    /**
     * 累计订单数
     */
    private Integer totalOrders;

    /**
     * 累计收入
     */
    private BigDecimal totalIncome;

    /**
     * 平均评分
     */
    private BigDecimal averageRating;

    /**
     * 评价总数
     */
    private Integer totalRatings;

    /**
     * 最后活跃时间
     */
    private LocalDateTime lastActiveTime;

    /**
     * 入职日期
     */
    private LocalDate joinDate;

    /**
     * 内部备注
     */
    private String notes;

    // 常量定义
    public static class Status {
        public static final String IDLE = "idle";
        public static final String WORKING = "working";
        public static final String REST = "rest";
        public static final String OFFLINE = "offline";
    }

    public static class AccountStatus {
        public static final String ACTIVE = "active";
        public static final String INACTIVE = "inactive";
        public static final String SUSPENDED = "suspended";
    }

    public static class Level {
        public static final String TRAINEE = "trainee";
        public static final String JUNIOR = "junior";
        public static final String SENIOR = "senior";
        public static final String EXPERT = "expert";
        public static final String MASTER = "master";
    }

    public static class Gender {
        public static final String MALE = "male";
        public static final String FEMALE = "female";
    }
}